package com.knight.controller;

import com.knight.model.JsonObject;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class TestController {

    @RequestMapping(value = "/index")
    public String index(Model model, @RequestParam(name = "name") String name, @RequestParam(name = "age") Integer age){
        System.out.println("请求到a方法了,请求参数 name="+name+", age="+age);
        model.addAttribute("message","hello");
        return "index";
    }

}
